package com.note.simpleshop.module.goods.controller;

import com.note.simpleshop.constant.ErrorCode;
import com.note.simpleshop.module.goods.service.ColumnService;
import com.note.simpleshop.module.goods.vo.ColumnVo;
import com.note.simpleshop.vo.Msg;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("goods/column")
public class ColumnController {
    @Autowired
    private ColumnService columnService;
    @ApiOperation(value = "index", notes = "获取首页栏目商品")
    @PostMapping(value = "index")
    public Msg index() {
        Msg msg=new Msg();
        msg.setErrorCode(ErrorCode.ERROR_0000);
        List<ColumnVo> list=columnService.findAll();
        msg.setData(list);
        return msg;
    }
}
